<?php
/**
 * Created by JetBrains PhpStorm.
 * User: guansong
 * Date: 17/2/28
 * Time: 下午3:26
 * To change this template use File | Settings | File Templates.
 */

namespace app\admin\controller;


use think\Controller;
use think\Request;

class BaseController extends Controller {
    public function __construct()
    {
        $res = Request::instance();
        $str = "admin/" . $res->controller() . "/" . $res->action();

        if(session("id"))
        {
            echo "欢迎" . session("loginname") . "登录系统";
            if(!$this->checkRule($str,session("id")))
            {
                echo session("loginname") . "没有" . $str . "的访问权限";
            }
        }
        else
        {
            echo "用户未登录！";
        }
    }

}